package Practice12;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapDemo {
    public static void main(String[] args) {
        HashMap<String,String> strMap = new HashMap<String, String>();
        strMap.put("黄晓明","杨颖");
        strMap.put("黄晓","杨");
        strMap.put("黄明","颖");
//        System.out.println(strMap);
//        System.out.println(strMap.remove("黄晓明"));
//        System.out.println(strMap);
//        System.out.println(strMap.get("黄晓"));
//        System.out.println(strMap.get("黄明"));
//        Set<String> keys = strMap.keySet();
//        for (String key : keys) {
//            String value = strMap.get(key);
//            System.out.println(key+value);
//        }

        Set<Map.Entry<String,String>> entrySets = strMap.entrySet();

        for (Map.Entry<String, String> entry : entrySets) {
            String key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key+value);
        }

    }
}
